<extend name="base/Base" />
<block name="Style">
<!-- FooTable Plugin CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/vendor/plugins/footable/css/footable.core.min.css">
		<!-- Admin Forms CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/assets/admin-tools/admin-forms/css/admin-forms.css">
		
</block>
<block name="Topbar">
								
   <header id="topbar" class="ph10">
        <div class="topbar-left">
          <ul class="nav nav-list nav-list-topbar pull-left">
           
			<li class="">
              <a href="__APP__/Admin/User/music_manage">音乐人管理</a>
            </li>
			
			<li class="active">
              <a href="#">未认领管理</a>
            </li>
			
			<li class="">
              <a href="__APP__/Admin/User/music_manage_shen.html">申请认领</a>
            </li>
			
          </ul>
        </div>
		<div class="topbar-right hidden-xs hidden-sm">
		 <a href="#"  onclick="selectAll()" class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star pr5"></span>全选</a>
			 <a href="#"   onclick="unSelect()"  class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star-o pr5"></span>不选</a>
			 <a href="#"    onclick="reverse()"class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star-half-o pr5"></span>反选</a>
			  <a href="#" onclick="tuijian()" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-play pr5"></span>加入推荐</a>
			  <a href="#" onclick="status(1)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-play pr5"></span>启用</a>
			  <a href="#" onclick="status(2)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-pause pr5"></span>停用</a>
			<a href="#" onclick="status(3)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-trash-o pr5"></span>密码</a>
			
			 
						  
          
        </div>
	</header>
	
	<div class="modal fade" id="usermyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
									  <div class="modal-dialog" role="document">
										<div class="modal-content">
										  <div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
											<h4 class="modal-title" id="myModalLabel">关联管理</h4>
										  </div>
										  <div class="modal-body">
											<div class="form-group">
												<label for="exampleInputEmail1">请输入用户UID</label>
												<input type="text" name="r_uid" id="r_uid" class="form-control"  placeholder="请输入用户UID">
											  </div>
											  
										
											  
											  <div class="form-group">
												<label for="exampleInputEmail1">请输入选择群组</label>
												<select class="form-control" id="r_group" name="r_group">
												 <volist name="group" id="group">
												  <option value="{$group.id}">
												  
												    {$group.name}
												  </option>
												 </volist>
												</select>
												
												
											  </div>
											  
											
											
														
														
														
													
												
																
						
										  </div>
										  <div class="modal-footer">
											<button type="button" class="btn btn-default" data-dismiss="modal">关闭页面</button>
											<a href="#" class="btn btn-primary" onclick="relevance()" >确认操作</a>
															<script>
						
							
							function relevance(){  
								var uid = $("#r_uid").val();
								var group = $("#r_group").val();
								
								
								if(uid==''){
								
									layer.msg('请输入用户UID');
								
								}else{
								
									
									$.ajax({
										type:'POST',
										url:"__APP__/Admin/User/Relevance.html",
										data:{
											"uid": uid,
											
											"group": group,
										
										},
										success:function(data){			
											var info = eval(data)
											if (info.errcode == 0) {
											
												layer.msg(info.errmsg);
												setTimeout(window.location.reload(),3000);
												
											}else{
												layer.msg(info.errmsg);
											}
										},
								
									});	
								
								}
								
								
								 
							}  
							</script>
										  </div>
										</div>
									  </div>
									</div>
	
				
</block>
<block name="Content">
	<!-- begin: .tray-center -->
        <div class="tray tray-center">

						
         	<script>
						
					function notice(msg){  
						layer.msg(msg);
					}	
							
							
							</script>
          <!-- recent orders table -->
          <div class="panel">
            <div class="panel-menu p12 admin-form theme-primary">
			
			
             <!--  <div class="row">
                <div class="col-md-10">
				
				
                  <label class="field select">
                    <select id="gid" name="filter-category" >
                   
					   
						 <option value="" selected="selected">全部群组</option>
				  
					<volist name="groups" id="groups">
						<option value="{$groups.id}" {$groups.selected}>{$groups.name}</option>
						   
						</volist>
                    </select>
                    <i class="arrow"></i>
                  </label>
                </div>
				 <div class="col-md-2">
				
				
                  <label class="field select">
                    <select id="status" name="filter-category" >
                   
					    <if condition="$statuss.id eq null"> 
				  
						 <option value="" selected="selected">用户状态</option>
						  
						  <else /> 
						   <option value="{$statuss.id}" selected="selected">{$statuss.title}</option>
						  <option value="" >用户状态</option>
						  
						  </if>
						  
						 
				  
                     
						<option value="1">启用中</option>
						<option value="2" >停用中</option>
					
                    </select>
                    <i class="arrow"></i>
                  </label>
                </div>
				</div> -->
            </div>
            <div class="panel-body pn" id="batchstatus">
			

              <div class="table-responsive">
                <table class="table footable"  data-filter="#fooFilter"  data-page-navigation=".pagination" data-page-size="100" >
                  <thead>
                    <tr class="bg-light"> 
					 
					 <th style="width:5%">批量</th>
					 <th style="width:5%">#</th>
                     
                      <th >昵称</th>
					<!-- <th >用户名</th> -->
					<th >手机</th>
					<th >邮箱</th>
					<th >注册时间</th>
					<!-- <th >所属群组</th>
					<th >权限优先级</th> -->
					<th >编辑</th>
                      <th >操作</th>
													
                      
                    </tr>
                  </thead>
                  <tbody>
				  <volist name="list" id="list">
                    <tr>
						<td class="text-center">
						<if condition="$list.id eq 1"> 
						
						<else /> 
						<center>
						<label class="option block mn">
						  <input type="checkbox" id="batch" name="batch" value="{$list.id}">
						
						</label>
						</center>
						
						</if>
						</td>
						<td class="">{$i}</td>
                      
                     	
                     <td class="">
                        <img class="img-responsive mw30 ib mr10" title="user" src="{$list.img}">{$list.nickname}(UID:{$list.id})
                      </td>
					  <!-- <td>{$list.username}</td> -->
					  <td>{$list.tel}</td>
					  <td>{$list.email}</td>
					  
					  <td >{$list.create_time|date="Y-m-d H:i:s",###}</td>
					  
					  <!--  <td >{$list.group_name}</td>
					   <td >
					  <if condition="$list.auth_type eq 1"> 
						<span style="color:blue;">群组</span>
						<else /> 
						<span style="color:green;">用户</span>
						</if>
					  
					  </td> -->
					 
					 
                       <td>
					    <if condition="$list.group_id eq 9"> 
						
						<span style="color:blue;" onclick="sessions({$list.id});">编辑</span>
					   </if>
					    </td>
						
                       <td>
					   <if condition="$list.id eq 1"> 
						
						<else /> 
						
						
						
							<div class="btn-group text-right">
						
						
						<if condition="$list.status eq 1"> 
						<button type="button" class="btn btn-success br2 btn-xs fs12 dropdown-toggle" data-toggle="dropdown" aria-expanded="false">启用中
						<elseif condition="$list.status eq 2"/>
						<button type="button" class="btn btn-danger br2 btn-xs fs12 dropdown-toggle" data-toggle="dropdown" aria-expanded="false">停用中
						
						<else /> 
						
						</if>
                          

						   <span class="caret ml5"></span>
                          </button>
                          <ul class="dropdown-menu" role="menu">
							<li >
                              <a  href="__APP__/Admin/User/Auth/uid/{$list.id}.html" target="_blank" >权限</a>
                            </li>
							<li >
                              <a  href="__APP__/Admin/User/Edit/id/{$list.id}.html" target="_blank" >编辑</a>
                            </li>
                            <li >
                              <a  href="__APP__/Admin/User/Login/id/{$list.id}.html" target="_blank" >登录</a>
                            </li>
                            
								
								
						   
                         
                          
							
                           
                          </ul>
                        </div>
						  </if>
						</td>
                          
							
                           
                      
                    </tr>
                </volist>
				</tbody>
				 <tfoot class="footer-menu">
				<tr>
				  <td colspan="12">
					<nav class="text-right">
					  <ul class="pagination hide-if-no-paging"></ul>
					</nav>
				  </td>
				</tr>
			  </tfoot>
                </table>
              </div>
            </div>
          </div>

		  
				<div class="col-md-12 digg">
				 <br>
					<center>
				 {$pages}
				</center>
				
			  </div>
			  
        </div>
        <!-- end: .tray-center -->

        <!-- begin: .tray-right -->
        <aside class="tray tray-right tray290" data-tray-height="match">
		<form action="__SELF__" method="get">
          <!-- menu quick links -->
          <div class="admin-form">

            <h4>搜索用户</h4>
			提示：<span style="color:red;">为空时则不作为搜索条件</span>

            <hr class="short">
			
			<div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="username" id="username" class="gui-input" placeholder="请输入用户名" value="{$username}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-flag"></i>
                </label>
              </label>
            </div>
			
			<div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="nickname" id="nickname" class="gui-input" placeholder="请输入用户姓名" value="{$nickname}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-user"></i>
                </label>
              </label>
            </div>
			
            <div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="uid" id="uid" class="gui-input" placeholder="请输入用户UID" value="{$uid}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-tag"></i>
                </label>
              </label>
            </div>
		
			<div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="tel" id="tel" class="gui-input" placeholder="请输入用户电话" value="{$tel}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-phone"></i>
                </label>
              </label>
            </div>
			
			<div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="email" id="email" class="gui-input" placeholder="请输入用户邮箱" value="{$email}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-leaf"></i>
                </label>
              </label>
            </div>
			
			
            <h5><small>请选择开始时间	</small></h5>
            <div class="section row mb15">
              <div class="col-md-12">
                <label for="price1" class="field prepend-icon">
				  <input name="begin_time" placeholder="请输入日期" value='{$begin_time|date="Y-m-d",###}' class="laydate-icon gui-input" onclick="laydate()">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-calendar"></i>
                  </label>
                </label>
              </div>
              
            </div>
			
			 <h5><small>请选择开始结束	</small></h5>
            <div class="section row mb15">
              <div class="col-md-12">
                <label for="price1" class="field prepend-icon">
				  <input name="end_time" placeholder="请输入日期" value='{$end_time|date="Y-m-d",###}' class="laydate-icon gui-input" onclick="laydate()">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-calendar"></i>
                  </label>
                </label>
              </div>
              
            </div>

			 <h5><small>请选择用户状态</small></h5>
            <div class="section mb15">
              <label class="field select">
                <select id="filter-categories" name="status">
				
                
				    <if condition="$statuss.id eq null"> 
				  
						 <option value="" selected="selected">用户状态</option>
						  
						  <else /> 
						   <option value="{$statuss.id}" selected="selected">{$statuss.title}</option>
						  <option value="" >用户状态</option>
						  
						  </if>
						  
					<option value="1">启用中</option>
						<option value="2" >停用中</option>   
						
                </select>
                <i class="arrow double"></i>
              </label>
            </div>
			
            <hr class="short">

            <div class="section">
                <button class="btn btn-default btn-sm ph25" type="submit" style="width:100%;">搜索用户</button>
               
            </div>

          </div>
		</form>
        </aside>
        <!-- end: .tray-right -->

   

</block>
<block name="Script">
	
  <!-- FooTable Plugin -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.all.min.js"></script>
   <!-- FooTable Addon -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.filter.min.js"></script>

 <script type="text/javascript">
		
		function tuijian(){
					 var id=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
					
					layer.confirm('你确定要这样做么？', {
					  btn: ['确定','取消'] //按钮
					}, function(){
					  
					  $.ajax({
							type:'POST',
							url:"__APP__/Admin/User/recommended.html",
							data:{
								
								"id": id,
								"recommended":1,
							},
							success:function(data){			
									var info = eval(data)
									if (info.errcode == 0) {
										layer.msg(info.errmsg);
										setTimeout(window.location.reload(),3000);
										
									}else{
										layer.msg(info.errmsg);
									}
							},
							error:function(){
								layer.msg('系统繁忙,请稍候重试！');
							}
						
						});	 
					  
					}, function(){
					  
					  
					});
			}
		
		
	
		function unSelect(){
				
		  $("input[id='batch']").each(function(){
		   $(this).prop("checked",false);
		  });  
		  
	
		}
		
		function selectAll(){
				
		 $("input[id='batch']").each(function(){
		   $(this).prop("checked",true);
		  });  
		  
		}
		
		function reverse(){
				
		 $("input[id='batch']").each(function(){
			$(this).prop("checked",!this.checked);   
		  
			})
		}
		
			
				
				
			
		
				function sessions(u_id){
				
					  $.ajax({
							type:'POST',
							url:"__APP__/Mall/User/Set_uid.html",
							data:{
								"u_id":u_id,
							},
							success:function(info){			
									
									if (info == 1) {
										//跳转到用户后台
										//setTimeout(window.location.reload(),3000);
										window.location.href="__APP__/Mall/User/Song.html"
									}else{
										layer.msg('授权失败，请稍后再试');
									}
							},
							error:function(){
								layer.msg('系统繁忙,请稍候重试！');
							}
						
						});	 
						  

				}
				
		
				function status(status){
				
				
						 var id=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
						
						layer.confirm('你确定要这样做么？', {
						  btn: ['确定','取消'] //按钮
						}, function(){
						  
						  $.ajax({
								type:'POST',
								url:"__APP__/Admin/User/Status.html",
								data:{
									
									"id": id,
									"status": status,
									
								},
								success:function(data){			
										var info = eval(data)
										if (info.errcode == 0) {
										
											layer.msg(info.errmsg);
											setTimeout(window.location.reload(),3000);
											
										}else{
											layer.msg(info.errmsg);
										}
								},
								error:function(){
									layer.msg('系统繁忙,请稍候重试！');
								}
							
							});	 
						  
						}, function(){
						  
						  
						});

				}
				
				
					$("#gid").change(function(){
						  	var gid = $("#gid").val();
							
							
							var url = '__APP__/Admin/User/Manage.html';
							url = url+'?gid='+gid;
						
							 self.location=url;
							
						
						
					});
					
					
						$("#status").change(function(){
						  	var status = $("#status").val();
							
							
							var url = '__APP__/Admin/User/Manage.html';
							url = url+'?status='+status;
						
							 self.location=url;
							
						
						
					});
					
						
					
  jQuery(document).ready(function() {

 

    // Init FooTable Examples
    $('.footable').footable();


  });
  </script>
</block>